@extends('admin.layouts.base')
@section('content')
    <el-col :span="12">
        <div class="grid-content bg-purple"></div>
        <el-form ref="form" :model="form" label-width="80px">
            <el-form-item label="类别名称">
                <el-input v-model="form.name"></el-input>
            </el-form-item>
             
            <el-form-item>
                <el-button type="primary" @click="onSubmit">立即创建</el-button>
                <el-button>取消</el-button>
            </el-form-item>
        </el-form>
    </el-col>
@endsection
@section('scripts')
    <script>
        new Vue({
            el: '#app',
            data: function () {
                return {
                    visible: false,
                    form: {
                        name: '',
                        // region: '',
                        // date1: '',
                        // date2: '',
                        // delivery: false,
                        attrs: [],
                        // resource: '',
                        // desc: ''
                    }
                }
            },
            methods: {
                onSubmit() {
                    axios.post('/category/store', this.form).then(function (res) {

                    });
                },
                addDomain() {
                    this.form.attrs.push({
                        name: '',
                        key: Date.now()
                    });
                }
            }
        })
    </script>
@endsection